package cn.yunhe.controller;

import java.io.IOException;
import java.util.List;

import cn.yunhe.dao.BookDao;
import cn.yunhe.daoImpl.BookDaoImpl;
import cn.yunhe.entity.Book;
import net.sf.json.JSONArray;

public class BooksAction extends BaseAction {

	private static final long serialVersionUID = 1L;
	
	BookDao bookDao = new BookDaoImpl();
	
	public String execute(){
		Book book = new Book();
		book.setCurrcount(-1);
		List<Book> listBook = bookDao.selectBook(book);
		try {
			System.out.println(JSONArray.fromObject(listBook).toString());
			getResponse().getWriter().write(JSONArray.fromObject(listBook).toString());
		} catch (IOException e) {
			System.out.println("BooksAction---execute");
			e.printStackTrace();
		}
		return null;
	}
}
